package com.example.testservice;

import com.example.testservice.IService.Stub;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

public class MyService extends Service {
	private static final String TAG = "MyService";

	@Override
	public IBinder onBind(Intent intent) {
		return myBind;
	}

	IService.Stub myBind = new Stub() {

		private static final String TAG = "myBind";
		private int state;

		public int getValue() throws RemoteException {
			return state;
		}

		@Override
		public long getCurrent() throws RemoteException {
			return System.currentTimeMillis();
		}

		@Override
		public void setValue(int value) throws RemoteException {
			state = value;
		}
	};
}
